import axios from "axios";
import useSWR from "swr";
function useUserInfo() {
  return useSWR("user-info", () => {
    return axios
      .get("/user/info")
      .then(res => {
        return res.data.data || null;
      })
      .catch(err => {
        return null;
      });
  });
}
export default useUserInfo;
